from common.case import read_cases, send_request, check
from common.db import DB


def login():
    DB().init_db('login.sql')
    cases=read_cases('login.xlsx',['用例编号', '用例说明', '接口路径','请求方法','请求类型', '参数', '预期结果'])
    for case in cases:
        case_info,url,method,request_type,args,expect=case
        res_type,actual=send_request(url,method,request_type,args)
        check(case_info,res_type,actual,expect)
if __name__=='__main__':
    login()
